package com.sishuok.springstudy;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * 通过FactoryBean获取自己定义的Bean
 */
@Component
public class MyFactoryBean implements FactoryBean<UserModel>{

	@Override
	public UserModel getObject() throws Exception {
		
		UserModel um = new UserModel();
		um.setId("id1111");
		um.setName("name2222");
		
		return um;
	}

	@Override
	public Class getObjectType() {
		return UserModel.class;
	}

}
